with Generic_Expression.Io;
with Ada.Text_Io; use Ada.Text_Io;
package Generic_Expressions.Io is

   procedure Get (X : out Expression) is
   begin
      Get(Current_Input,X);
   end Get;

   procedure Get (F : File_Type;
                  X : out Expression);

   procedure Put (X : in Expression) is
   begin
      Put(Current_Output,X);
   end Put;

   procedure Put (F : File_Type;
                  X : in Expression) is
   begin
      case X.Model;
         when Valeur => Put(X.Val);
         when Unaire =>
            Put(Operateur_Unaire'Image(X.Operator));
            Put(X.Argument.All);
         when Binaire =>
            Put(X.Avant.all);
            Put(Operateur_binaire'Image(X.Operator));
            Put(X.Apres.all);
      end case;
   end Put;


end Generic_Expressions.Io;
